﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace comm
{
    public enum ConsoleColor
    {
        NORMAL = 0,
        RED = 1,
        YELLOW = 2
    }

    public abstract class BConsole
    {
        public static Action<object, ConsoleColor, StackFrame> OnWriteLine = null;

        public static void WriteLine(object value)
        {
            WriteLine(value, ConsoleColor.NORMAL, new StackTrace(true).GetFrame(1));
        }
        public static void WriteLine(object value, ConsoleColor color, StackFrame stackFrame = null)
        {
            if (stackFrame == null)
            {
                stackFrame = new StackTrace(true).GetFrame(1);
            }
            if (OnWriteLine != null)
            {
                OnWriteLine(value, color, stackFrame);
            }
            else
            {
                System.Console.WriteLine(value);
            }
        }
    }
}
